package com.atguigu.gmall.search.dao;

import com.atguigu.gmall.search.bean.Person;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * 1、ElasticsearchRepository: 专门针对Es的
 * 2、CrudRepository：普通增删改查
 * 3、PagingAndSortingRepository：即包含了2，还有分页
 */
public interface PersonEsDao extends PagingAndSortingRepository<Person,Long> {
    //SpringData
    List<Person> findAllByAgeBetween(Integer age, Integer age2);

    //18到20之间或者名字叫田七
    List<Person> findAllByAgeBetweenOrNameEquals(Integer age, Integer age2, String name);

    List<Person> findAllByAddressLike(String address);

    List<Person> findAllByAddressLikeAndAgeBetweenAndIdGreaterThanEqual(String address, Integer age, Integer age2, Long id);
}
